package standard

import "go-forth/pkg/forth"

func CompileComma(vm forth.StackVM) {
	vm.Append(vm.Pop())
}

func Again(vm forth.StackVM) {
	vm.Push(0) // STATE
	Fetch(vm)
	if vm.Pop() == vFalse {
		panic("undefined")
	}
	dest := vm.ControlStack().Pop().(int)
	vm.Append(func(vm forth.StackVM) {
		vm.Goto(dest)
	})
}
